package org.springframework.web.servlet.ajax.json;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ViewResolver;

/**
 * Knows how to resolve a conglomeration of keys and views and turn them into
 * a JSON object.
 * @author Charles Tassoni
 */

public interface PartialsCore {

	public abstract void setThrowExceptionIfRenderedContentIsEmpty(
			boolean throwExceptionIfRenderedContentIsEmpty);

	public abstract JsonSerializer getJsonSerializer();

	public abstract void setJsonSerializer(JsonSerializer jsonSerializer);

	public abstract void setJsonRequestAttribute(String jsonRequestAttribute);

	public abstract void setJsonResponseHeaderName(String jsonResponseHeaderName);

	public abstract void setRedirectCommand(String redirectCommand);

	public abstract void setViewResolverDelegate(
			ViewResolver viewResolverDelegate);

	public abstract LinkedHashMap makeMap(List<String> keys,
			List<String> viewNames, Map modelMap, HttpServletRequest request,
			HttpServletResponse response);

	public abstract void writeJsonRedirect(String relativePath,
			HttpServletRequest request, HttpServletResponse response);

	public abstract void write(HttpServletResponse response, String jsonContent);

}